<template>
	<view class="my-info">
		<view class="avatar">教育背景</view>
		<view class="content">
			<view class="myitem">
				<van-cell-group>
					<u-cell-item :border-bottom="border" :title-style="style" title="起始时间" @click="chooseStart()"
						:value="info.startTime">
					</u-cell-item>
					<u-cell-item :border-bottom="border" :title-style="style" title="结束时间" @click="chooseEnd()"
						:value="info.endTime">
					</u-cell-item>
					<u-cell-item :border-bottom="border" :title-style="style" title="毕业院校" :arrow="false">
						<u-input input-align="right" placeholder="毕业院校" slot="right-icon" v-model="info.school"
							:clearable="border" :custom-style="inputStyle"></u-input>
					</u-cell-item>
					<u-cell-item :border-bottom="border" :title-style="style" title="专 业" :arrow="false">
						<u-input input-align="right" placeholder="专业" slot="right-icon" v-model="info.major"
							:clearable="border" :custom-style="inputStyle"></u-input>
					</u-cell-item>
				</van-cell-group>
			</view>
			<view>{{data.username}}</view>
			<button type="default" class="mybutton" @click="next()">下一步</button>

		</view>
		<!-- 起始时间选项框 -->
		<u-picker mode="time" v-model="startShow" :params="timeParams" @confirm="getStartTime()"
			:default-time="startDay"></u-picker>

		<!-- 结束时间弹出选项框 -->
		<u-picker mode="time" v-model="endShow" :params="timeParams" @confirm="getEndTime()" :default-time="startDay">
		</u-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {
					school: "",
					major: "",
					startTime: '未选择',
					endTime: '未选择',
					username: ''
				},
				info1:null,

				border: false,
				fileList: [],
				list: [{
						text: '男',
						fontSize: 32
					},
					{
						text: '女',
						fontSize: 32
					}
				],
				regionParams: {
					province: true,
					city: true,
					area: false
				},
				timeParams: {
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				},
				inputStyle: {
					'width': '400rpx',
				},
				startShow: false,
				endShow: false,
				imgArr: ['../../static/fish.jpg'],
				style: {
					'font-size': '26rpx',
					'font-weight': 'bold'
				},
				startRegion: ['广东省', '广州市'],
				data: {}
			}
		},
		methods: {
			onLoad() {
				
			},

			next() {
				uni.setStorage({
					key:'education-info',
					data:this.info,
					success() {
						console.log("存储成功")
						uni.navigateTo({
							url: "../skill-info/skill-info"
						})
					}
				})
			
				// uniCloud.callFunction({
				// 	name: "basicInfo",
				// 	data: {
				// 		username: this.data.username,
				// 		position: this.data.position,
				// 		workex: this.data.workex,
				// 		tel: this.data.tel,
				// 		email: this.data.email,
				// 		blog: this.data.blog,
				// 		sex: this.data.sex,
				// 		region: this.data.region,
				// 		endTime: this.data.region,
				// 		id: 21
				// 	},
				// 	success: (res) => {
				// 		console.log(res);
				// 	},
				// 	fail: (err) => {
				// 		console.log(err);
				// 	}
				// })
			
			},
			getStartTime(e) {
				this.info.startTime = `${e.year}-${e.month}-${e.day}`
				this.startDay = `${e.year}-${e.month}-${e.day}`
			},
			getEndTime(e) {
				this.info.endTime = `${e.year}-${e.month}-${e.day}`
				this.startDay = `${e.year}-${e.month}-${e.day}`
			},
			chooseStart() {
				this.startShow = true
			},
			chooseEnd() {
				this.endShow = true
			},
		}
	}
</script>

<style scoped lang="scss">
	.my-info {
		background: rgba(224, 226, 252, 0.6);
		min-height: 100vh;
		height: auto;
		padding-bottom: 30rpx;
	}

	.inputStyle {
		width: 100%;
		background-color: red;
	}

	.avatar {
		height: 100rpx;
		padding: 20px 0;
		font-size: 30rpx;
		color: #928cd6;
		font-weight: 600;
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.content {
		margin: 0 30rpx;
	}

	.avatar>image {
		width: 200rpx;
		height: 200rpx;
		border-radius: 100rpx;
	}

	.myitem {
		background-color: #ffffff;
		width: 100%;
		padding: 18rpx 0;
		border-radius: 20rpx;
		box-sizing: border-box;
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
		margin-bottom: 40rpx;
		background-size: 100% 100%;
	}

	.mybutton {
		background-color: #ffffff;
		width: 100%;
		height: 90rpx;
		font-size: 27rpx;
		color: #928cd6;
		border-radius: 20rpx;
		box-sizing: border-box;
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
		margin-bottom: 20rpx;
		line-height: 96rpx;
	}

	.myinput {
		background-color: #ffffff;
		width: 80%;
		height: 120rpx;
		font-size: 30rpx;
		font-weight: bold;
		color: #928cd6;
		border-radius: 40rpx;
		box-sizing: border-box;
		margin: 50rpx auto;
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
		margin-bottom: 20rpx;
		line-height: 96rpx;
	}

	.mybuttonb {
		background-color: #ffffff;
		width: 100%;
		height: 90rpx;
		font-size: 27rpx;
		color: #c65c69;
		border-radius: 20rpx;
		box-sizing: border-box;
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
		margin-bottom: 20rpx;
		line-height: 96rpx;
	}
</style>
